//
//  HuisangsuoApi.m
//  HSSLicAI
//
//  Created by huishangsuo on 15/8/28.
//  Copyright (c) 2015年 huishangsuo. All rights reserved.
//

#import "HuisangsuoApi.h"
#import "AFNetworking.h"



@implementation HuisangsuoApi

#pragma mark ================  商城ShoppingMallAPI =================
+ (NSString * )shoppingMallUrlString {
    return @"http://chailihua.shouge.pw";
}
+ (void)requestgetDate :(NSString * )url dic:(NSDictionary * )dic AndBack:(MyCallback)callback  error:(ErrorBlock)errorblock {
    NSString * path  = [NSString stringWithFormat:@"%@%@",[HuisangsuoApi shoppingMallUrlString],url];
    AFHTTPSessionManager * manager = [AFHTTPSessionManager manager];
    manager.requestSerializer = [AFJSONRequestSerializer serializer];
    [manager setResponseSerializer:[AFHTTPResponseSerializer serializer]];
    [manager.requestSerializer setValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
    [manager POST:path parameters:dic progress:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        callback(dic);
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"error  ===== %@",error);
    }];
}

@end
